$(document).ready(function () {
    fcssy.onload();
})

var fcssy = (function () {

    var init = function () {
		$(window).resize(function(){
			fcssy.windowResize()
		});
    }

    return {
        onload : function () {
            init();
            fcssy.tablePage();
//          fcssy.windowResize();
            fcssy.tableData()
            
        },
        /*页面大小计算*/
        windowResize:function(){
         	var content_xxcj_h=$(document).height()-20;
			$(".wxl_syxxcj_box").css("height",content_xxcj_h+"px");
		},
        /*table表格分页*/
       tablePage:function(){
       	$('#wxl_fcssy').dataTable( {
	        "pagingType":   "full_numbers",
	          "info": false,
	          "pageLength":7,
	          "lengthChange": false,
	          "ordering":false,
	          "searching": false
	    });
       },
        /*table表格数据*/
	    tableData:function(){
	    	var data = [{
	 				"number": "01",
	 				"houseCode": "AAAA",
	 				"certificate": "税申报",
	 				"houseName": "银行家属院",
	 				"houseAddressS": "郑州市",
	 				"houseAddressX": "东风路",
	 				"houseAddressD": "银行家属院",
	 				"taxAuthorities": "2018-05-01",
	 				"operation": null
	 			},
	 			{
	 				"number": "02",
	 				"houseCode": "BBBB",
	 				"certificate": "税申报",
	 				"houseName": "银行家属院",
	 				"houseAddressS": "郑州市",
	 				"houseAddressX": "东风路",
	 				"houseAddressD": "银行家属院",
	 				"taxAuthorities": "2018-05-01",
	 				"operation": null
	 			}
	 		];
	 		$('#wxlFcssy').DataTable({
	 			"data": data,
	 			"columnDefs": [{
	 					"targets": -1,
	 					"data": null,
	 					"render": function(data, type, full, meta) {
 							return '<a href="fcssy_form.html"><span class="btn wxl_bg_yel">基本信息</span></a><a href="fcssyxx.html"><span class="btn wxl_bg_lan1">应税明细</span></a><a href="fcssy_ywzz.html"><span class="btn wxl_bg_red">义务终止</span></a>'
	 					}
	 				},
	 				{
	 					'targets': 0,
	 					'className': 'dt-body-center',
	 					'render': function(data, type, row) {
	 						return '<input class="checkchild" type="checkbox"/>';
	 					}
	 				}
	 			],
	 			"columns": [
	 			    {
	 					"data": "btn"
	 				},
	 			    {
	 					"data": "number"
	 				},
	 				{
	 					"data": "houseCode"
	 				},
	 				{
	 					"data": "certificate"
	 				},
	 				{
	 					"data": "houseName"
	 				},
	 				{
	 					"data": "houseAddressS"
	 				},
	 				{
	 					"data": "houseAddressX"
	 				},
	 				{
	 					"data": "houseAddressD"
	 				},
	 				{
	 					"data": "taxAuthorities"
	 				},
	 				{
	 					"data": "operation"
	 				}
	 			],
	// 			"paging": false,
	 			"info": false,
	 			"lengthChange": false,
	 			"searching": false,
	 			"scrollX":true
	 		})
	    },
       
      }
})();
